package com.crm.crmback.model;

public class MonthIncome {
    /**
     * #left函数 表示的是截取字符串order_date 的左边数7位，例如 2018-03-22 截取7位就是 2018-03
     * #convert 函数，convert(course_price, decimal (18, 2)表示的就是将 course_price(是varchar类型)转换成 decimal 小数点格式的
     * # 然后保留两位小数，
     * select
     *   left(order_date, 7) as month,
     *   count(*) as total,
     *   sum(convert(course_price, decimal (18, 2))) as income
     * from
     *   t_course_order
     * group by left(order_date, 7);
     *
     * 根据 as 后面的封装一个实体类
     */
    private String month;//月份，哪个月
    private String total;//每月的订单数
    private String income;//每个月的收入总和

    @Override
    public String toString() {
        return "MonthIncome{" +
                "month='" + month + '\'' +
                ", total='" + total + '\'' +
                ", income='" + income + '\'' +
                '}';
    }

    public String getMonth() {
        return month;
    }

    public void setMonth(String month) {
        this.month = month;
    }

    public String getTotal() {
        return total;
    }

    public void setTotal(String total) {
        this.total = total;
    }

    public String getIncome() {
        return income;
    }

    public void setIncome(String income) {
        this.income = income;
    }
}
